package com.itheima.service;

import com.itheima.dao.impl.BrandMapperImpl;
import com.itheima.bean.Brand;

import java.util.List;

//业务层
public class BrandService {
    private final BrandMapperImpl brandMapperImpl = new BrandMapperImpl();

    //显示全部品牌
    public List<Brand> selectAll(){
        return brandMapperImpl.selectAll();
    }

    //根据id查找品牌
    public Brand selectBrandById(Integer id){
        Brand brand = brandMapperImpl.selectBrandById(id);
        return brand;
    }

    //添加品牌
    public void add(Brand brand){
        brandMapperImpl.add(brand);
    }

    //删除品牌
    public void deleteBrandById(Integer id){
        brandMapperImpl.deleteBrand(id);
    }

    //修改品牌
    public void upDateBrand(Brand brand){
        brandMapperImpl.upDate(brand);

    }

}
